<div class="layui-fluid" id="VIEW-list-table" lay-title="sku选择列表" lig-title="sku-choose-title">
    <form class="layui-form" lay-filter="lig-sku-searchform">
        <div style="padding:10px;">
            <div class="layui-row">
                <div class="layui-inline">
                    <label class="layui-form-label" lig-lang="sku-spbh">商品编号</label>
                    <div class="layui-inline">
                        <input type="text" class="layui-input" name="spbh" />
                    </div>
                </div>
                <div class="layui-inline">
                    <label class="layui-form-label" lig-lang="sku-spmc">商品名称</label>
                    <div class="layui-inline">
                        <input type="text" class="layui-input" name="spmc" />
                    </div>
                </div>
                <div class="layui-inline">
                    <div class="layui-row layui-col-space10">
                        <div class="layui-col-xs6">
                            <div class="layui-btn layui-btn-sm" lay-filter="lig-sku-search" lig-lang="btn-search">查询</div>
                        </div>
                        <div class="layui-col-xs6">
                            <button type="reset" class="layui-btn layui-btn-sm layui-btn-primary" lig-lang="btn-reset">重置</button>
                        </div>
                    </div>
                </div>
            </div>
            <div class="layui-row">
                <table lay-filter="lig-sku-choose-table"></table>
            </div>
        </div>
        <div class="layui-form-item">
            <div class="ligui-layer-btn" style="text-align:right;pointer-events:auto;">
                <a class="ligui-layer-btn0 ligui-choose" lay-filter="lig-ok">确 定</a>
                <a class="ligui-layer-btn1 ligui-cancel" lay-filter="lig-cancel">取 消</a>
            </div>
        </div>
    </form>
</div>
<script type="text/html" id="tpl-splb">
    {{#
    var splbmc = d.splbmc;
    if (d.splbmc2 != '') {
    splbmc += '-' + d.splbmc2;
    }
    if (d.splbmc3 != '') {
    splbmc += '-' + d.splbmc3;
    }
    }}
    <span>{{splbmc}}</span>
</script>
<script>
    layui.use(['admin', 'table', 'form', 'layer', 'jquery', 'lig'], function (admin, table, form, layer, $, lig) {
        form.render();

        lig.table({
            elem: '[lay-filter="lig-sku-choose-table"]',
            height: '300px',
            url: 'pd/sku/page',
            cols: [[
                { title: '', type: 'radio', fixed: true, width: 60 },
                { title: '<span lig-lang="sku-spbh">商品编号</span>', field: 'spbh', minWidth: 100 },
                { title: '<span lig-lang="sku-splb">商品类别</span>', field: 'splbmc', minWidth: 200},
                { title: '<span lig-lang="sku-spmc">商品名称</span>', field: 'spmc', minWidth: 100 },
                { title: '<span lig-lang="sku-pp">品牌</span>', field: 'pp', minWidth: 100 },
                { title: '<span lig-lang="sku-cz">材质</span>', field: 'cz', minWidth: 100 },
                { title: '<span lig-lang="sku-dw">单位</span>', field: 'dw', minWidth: 100 },
                { title: '<span lig-lang="sku-zl">重量</span>', field: 'zl', minWidth: 100 },
                { title: '<span lig-lang="sku-zldw">重量单位</span>', field: 'zldw', minWidth: 100 }
            ]]
        }, {
            mode: 'dialog',
            entity: 'sku',
            primaryField: 'skuId'
        });

        $('[lay-filter="lig-save"]').click(function () {
            var datas = table.checkStatus('skuId').data;
            if (datas || datas.length > 0) {
                parent.choose_sku = datas[0];
            }
            layer.close(layer.index);
        });
        $('[lay-filter="lig-cancel"]').click(function () {
            layer.close(layer.index);
        });
    })
</script>